package org.yuyao.system.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.yuyao.common.controller.BaseController;
import org.yuyao.common.domain.vo.YuyaoResponse;
import org.yuyao.system.entity.SysUser;
import org.yuyao.system.service.ISysUserService;

@RestController
@RequestMapping("sysUser")
public class SysUserController extends BaseController {

    @Autowired
    private ISysUserService sysUserService;


    @GetMapping("getByUsername/{username}")
    public YuyaoResponse getByUsername(@PathVariable("username") String username) {
        return success(sysUserService.selectByUserName(username));
    }

    @PostMapping("add")
    public YuyaoResponse add(@RequestBody SysUser sysUser) {
        return success(sysUserService.insert(sysUser));
    }




}
